package com.example.kafka.pojo;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

@Data
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
@Document(indexName = "nr_indicators")
public class NRMetricData {

    /**
     * es id
     */
    @Id
    private String id;

    /**
     * 指标ID
     */
    @JsonInclude
    private String metricId;

    /**
     * 对象ID
     */
    @JsonInclude
    private String structureId;

    /**
     * 主机hostname
     */
    @JsonInclude
    @Field(type = FieldType.Text)
    private String endpoint;

    /**
     * 指标项
     */
    @JsonInclude
    @Field(type = FieldType.Text)
    private String metric;

    /**
     * 所属系统
     */
    @JsonInclude
    @Field(type = FieldType.Text)
    private String value;

    /**
     * 上报的时间周期
     */
    @JsonInclude
    @Field(type = FieldType.Long)
    private Integer step;

    /**
     * 指标类型，支持两种类型GAUGE和COUNTER。
     */
    @JsonInclude
    @Field(type = FieldType.Text)
    private String counterType;

    /**
     * 被监测指标的非预定义属性，
     */
    @JsonInclude
    @Field(type = FieldType.Text)
    private String tags;

    /**
     * 时间戳,自UTC时间1970-01-01 00:00:00到当前时间的秒数
     */
    @JsonInclude
    @Field(type = FieldType.Long)
    private String timestamp;

    /**
     * 时间，格式：2022-04-07T01:11:50.000Z
     */
    @JsonInclude
    @Field(type = FieldType.Date)
    private String indextime;

}
